//
//  TF_InvitationList.swift
//  TalkfunSDKDemo
//
//  Created by 莫瑞权 on 2022/2/18.
//  Copyright © 2022 Talkfun. All rights reserved.
//

import UIKit

class TF_InvitationList: UIButton {
    @objc public var show = UIImageView()

    override init(frame: CGRect) {
        super.init(frame: frame)

        self.setImage(UIImage.init(named: "HTLive.bundle/bang"), for: .normal)
        self.imageView?.image = UIImage.init(named: "HTLive.bundle/bang")
        self.setTitle("邀请榜单", for: .normal)
        
       
        self.titleLabel!.font = UIFont.PingFang(size: 12)
        
        self.imageView!.contentMode = .scaleAspectFit
 
        //TODO:榜单     
        self.addSubview(self.show)
        self.show.image = UIImage.init(named: "HTLive.bundle/popbang")
        
       
        self.show.contentMode = .scaleAspectFit
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        self.imageView!.frame = CGRect(x: 9.0, y: (self.frame.size.height - 12.55 )/2.0, width: 12.55, height: 12.55)
        
        self.titleLabel!.frame = CGRect(x: 27.5, y: 0, width: 48, height: self.frame.size.height)

        self.show.frame = CGRect(x: self.titleLabel!.frame.maxX + 4, y: 0, width: 5.2, height: self.frame.size.height)

        
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
        
        let biggerFrame =  self.bounds.insetBy(dx: -20, dy:  -20)

        return biggerFrame.contains(point)
    }

}
